package org.example

import redis.clients.jedis.{JedisPool, JedisPoolConfig}

/**
 * @author yangzhen14
 * @create 2021/4/22 17:01
 */

/**
 * Redis连接池
 */
object RedisClient extends Serializable {

  val redisHost = "10.13.43.67"
  val redisPort = 32775
  val redisTimeout = 30000

  lazy val pool = new JedisPool(new JedisPoolConfig, redisHost, redisPort, redisTimeout)

  import scala.concurrent.ExecutionContext.Implicits.global

  /*
    lazy val hook = Future {
      println("Execute hook thread :" + this)
      pool.destroy()
    } onComplete {
      case Success(value) => println "success" + value
      case Failure(value) => println "failure" + value
    }
  */


}
